<template>
	<view>
		<view class="futures_cont" v-for="(item, key) in dataList" :key="key" @click='cli(item)'>
			<view class="cont_top">
				<view class="top_text">
					<view class="tit">
						<u-avatar :src="item.img" size="60"></u-avatar>
						<view class="item_name">
							{{item.name}}
						</view>
					</view>
					<view class="text">简介：{{item.presentation}}</view>
				</view>
			</view>
			<view class="cont_bottom">立即开户</view>
		</view>
	</view>
</template>

<script>
	import {
		openAccount
	} from '@/api/trader.js'
	export default {
		created() {
			this.accountCloud()
		},
		data() {
			return {
				dataList: [],
				img: [{
					src: ''
				}],
			};
		},
		methods: {
			async cli(item) {
				uni.showModal({
					title:"须前往 APP 开户"
				})
				// uni.setStorageSync('item', item);
				// uni.setStorageSync('brokerId', item.brokerId);
				// uni.setStorageSync('cfmmcUrl', item.cfmmcUrl);
				// uni.setStorageSync('channel', item.channel);
				// await openAccount()
			},
			accountCloud() {
				uni.request({
					url: 'https://wechat.sou-liang.com/api/v1/kaiHuYun',
					data: {},
					success: (res) => {
						this.dataList = res.data.data
						let data = res.data.data
						let num = res.data.data.length
						for (let i = 0; i < num; i++) {
							this.img.push(data[i].img)
						}
					}
				});
			}
		}
	}
	
</script>

<style lang="scss" scoped>
	page {
		background: #FFFFFF;
	}

	.item_name {
		margin-left: 120rpx;
		margin-top: -70rpx;
	}

	.futures_cont {
		padding: 15px 20px;
		border-bottom: 1rpx solid #969595;

		.cont_top {
			display: flex;
			align-items: center;
			margin-bottom: 10px;

			.top_img {
				// width: 50px;
				margin-right: 10px;

				.img {
					width: 60px;
					height: 60px;
				}
			}

			.top_text {
				.tit {
					font-size: 16px;
					font-weight: bold;
					margin-bottom: 5px;
				}

				.text {
					font-size: 12px;
					padding: 25rpx 0px 0px 0px;
				}
			}
		}

		.cont_bottom {
			text-align: center;
			width: 100%;
			height: 44px;
			margin-top: 15px;
			line-height: 44px;
			font-size: 15px;
			color: #fff;
			border-radius: 5px;
			background-color: #f0b104;
		}
	}
</style>